package org.mm.model;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;


/**
 * The persistent class for the drug_types database table.
 *
 */
@Entity
@Table(name="drug_types")
public class DrugType implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -5950308194174391150L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="drug_type_id")
	private Long drugTypeId;

	@Column(name="drug_type_creation_date")
	private Timestamp drugTypeCreationDate;

	@Column(name="drug_type_description")
	private String drugTypeDescription;

	@Column(name="drug_type_last_modification_date")
	private Timestamp drugTypeLastModificationDate;

	@Column(name="drug_type_short_description")
	private String drugTypeShortDescription;

	@Version
	@Column(name="drug_type_version")
	private int drugTypeVersion;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="drug_type_created_by_user")
	private User user1;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="drug_type_last_modified_by_user")
	private User user2;

/*	//bi-directional many-to-one association to Drug
	@OneToMany(mappedBy="drugType", fetch=FetchType.EAGER)
	private List<Drug> drugs;*/

	public DrugType() {
	}

	public Long getDrugTypeId() {
		return this.drugTypeId;
	}

	public void setDrugTypeId(Long drugTypeId) {
		this.drugTypeId = drugTypeId;
	}

	public Timestamp getDrugTypeCreationDate() {
		return this.drugTypeCreationDate;
	}

	public void setDrugTypeCreationDate(Timestamp drugTypeCreationDate) {
		this.drugTypeCreationDate = drugTypeCreationDate;
	}

	public String getDrugTypeDescription() {
		return this.drugTypeDescription;
	}

	public void setDrugTypeDescription(String drugTypeDescription) {
		this.drugTypeDescription = drugTypeDescription;
	}

	public Timestamp getDrugTypeLastModificationDate() {
		return this.drugTypeLastModificationDate;
	}

	public void setDrugTypeLastModificationDate(Timestamp drugTypeLastModificationDate) {
		this.drugTypeLastModificationDate = drugTypeLastModificationDate;
	}

	public String getDrugTypeShortDescription() {
		return this.drugTypeShortDescription;
	}

	public void setDrugTypeShortDescription(String drugTypeShortDescription) {
		this.drugTypeShortDescription = drugTypeShortDescription;
	}

	public int getDrugTypeVersion() {
		return this.drugTypeVersion;
	}

	public void setDrugTypeVersion(int drugTypeVersion) {
		this.drugTypeVersion = drugTypeVersion;
	}

	public User getUser1() {
		return this.user1;
	}

	public void setUser1(User user1) {
		this.user1 = user1;
	}

	public User getUser2() {
		return this.user2;
	}

	public void setUser2(User user2) {
		this.user2 = user2;
	}

/*	public List<Drug> getDrugs() {
		return this.drugs;
	}

	public void setDrugs(List<Drug> drugs) {
		this.drugs = drugs;
	}

	public Drug addDrug(Drug drug) {
		getDrugs().add(drug);
		drug.setDrugType(this);

		return drug;
	}

	public Drug removeDrug(Drug drug) {
		getDrugs().remove(drug);
		drug.setDrugType(null);

		return drug;
	}*/

}